package com.mobileares.midp.widgets.client.page;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2010-8-13
 * Time: 16:27:36
 * To change this template use File | Settings | File Templates.
 */
public abstract class AbstractAccess implements IsAccess {

    public AbstractAccess() {
        this(_OR);
    }

    public AbstractAccess(AbstractAccessConstant regular) {
        setRegular(regular);
    }

    private AbstractAccessConstant regular;

    public static class AbstractAccessConstant {
        String name;

        private AbstractAccessConstant(String name) {
            this.name = name;
        }
    }

    public static final AbstractAccessConstant _OR = new AbstractAccessConstant("or");
    public static final AbstractAccessConstant _AND = new AbstractAccessConstant("and");

    public AbstractAccessConstant getRegular() {
        return regular;
    }

    public void setRegular(AbstractAccessConstant regular) {
        this.regular = regular;
    }

    /**
     * @return
     * @deprecated
     */
    public boolean isAccess() {
        return isAccess(null);
    }

    public boolean isAccess(IFunctionModel function) {
        return true;
    }
}
